#ifndef FILEUTIL_H
#define FILEUTIL_H

#include "../global/xnamespace.h"
#include <QQmlEngine>

X_BEGIN_NAMESPACE

// 为QML提供的文件工具
class FileUtil : public QObject
{
    Q_OBJECT

public:
    FileUtil();

    static FileUtil &instance();
    static const char *qmlName();
    static QObject *qmlInstance(QQmlEngine *engine, QJSEngine *scriptEngine);

    Q_INVOKABLE bool exists(QString fileName);

private:
    static FileUtil *createInstance();
};

X_END_NAMESPACE

#endif // FILEUTIL_H
